<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class filter</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Log v2">
<link rel="up" href="../../expressions.html#header.boost.log.expressions.filter_hpp" title="Header &lt;boost/log/expressions/filter.hpp&gt;">
<link rel="prev" href="expressions/attr_idp33863840.html" title="Function template attr">
<link rel="next" href="filter/default_filter.html" title="Struct default_filter">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="expressions/attr_idp33863840.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../expressions.html#header.boost.log.expressions.filter_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="filter/default_filter.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.log.filter"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class filter</span></h2>
<p>boost::log::filter</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../expressions.html#header.boost.log.expressions.filter_hpp" title="Header &lt;boost/log/expressions/filter.hpp&gt;">boost/log/expressions/filter.hpp</a>&gt;

</span>
<span class="keyword">class</span> <a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="keyword">bool</span> <a name="boost.log.filter.result_type"></a><span class="identifier">result_type</span><span class="special">;</span>  <span class="comment">// Result type. </span>

  <span class="comment">// member classes/structs/unions</span>

  <span class="comment">// Default filter, always returns <code class="computeroutput">true</code>. </span>

  <span class="keyword">struct</span> <a class="link" href="filter/default_filter.html" title="Struct default_filter">default_filter</a> <span class="special">{</span>
    <span class="comment">// types</span>
    <span class="keyword">typedef</span> <span class="keyword">bool</span> <a class="link" href="filter/default_filter.html#boost.log.filter.default_filter.result_type"><span class="identifier">result_type</span></a><span class="special">;</span>

    <span class="comment">// <a class="link" href="filter/default_filter.html#idp33877760-bb">public member functions</a></span>
    <span class="identifier">result_type</span> <a class="link" href="filter/default_filter.html#idp33878320-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="identifier">attribute_value_set</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="special">}</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="filter.html#boost.log.filterconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="filter.html#idp33890560-bb"><span class="identifier">filter</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="filter.html#idp33891760-bb"><span class="identifier">filter</span></a><span class="special">(</span><a class="link" href="filter.html" title="Class filter">filter</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="filter.html#idp33893440-bb"><span class="identifier">filter</span></a><span class="special">(</span><a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> FunT<span class="special">&gt;</span> <a class="link" href="filter.html#idp33895360-bb"><span class="identifier">filter</span></a><span class="special">(</span><span class="identifier">FunT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;</span> <a class="link" href="filter.html#idp33897680-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;</span> <a class="link" href="filter.html#idp33900176-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="filter.html" title="Class filter">filter</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> FunT<span class="special">&gt;</span> <a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;</span> <a class="link" href="filter.html#idp33902432-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="identifier">FunT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="filter.html#idp33881440-bb">public member functions</a></span>
  <span class="identifier">result_type</span> <a class="link" href="filter.html#idp33882000-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="identifier">attribute_value_set</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="filter.html#idp33886128-bb"><span class="identifier">reset</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="filter.html#idp33887888-bb"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp125550112"></a><h2>Description</h2>
<p>Log record filter function wrapper. </p>
<div class="refsect2">
<a name="idp125550832"></a><h3>
<a name="boost.log.filterconstruct-copy-destruct"></a><code class="computeroutput">filter</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idp33890560-bb"></a><span class="identifier">filter</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Default constructor. Creates a filter that always returns <code class="computeroutput">true</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp33891760-bb"></a><span class="identifier">filter</span><span class="special">(</span><a class="link" href="filter.html" title="Class filter">filter</a> <span class="keyword">const</span> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre>
<p>Copy constructor </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp33893440-bb"></a><span class="identifier">filter</span><span class="special">(</span><a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;&amp;</span> that<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Move constructor. The moved-from filter is left in an unspecified state. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> FunT<span class="special">&gt;</span> <a name="idp33895360-bb"></a><span class="identifier">filter</span><span class="special">(</span><span class="identifier">FunT</span> <span class="keyword">const</span> <span class="special">&amp;</span> fun<span class="special">)</span><span class="special">;</span></pre>
<p>Initializing constructor. Creates a filter which will invoke the specified function object. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;</span> <a name="idp33897680-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;&amp;</span> that<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Move assignment. The moved-from filter is left in an unspecified state. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;</span> <a name="idp33900176-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="filter.html" title="Class filter">filter</a> <span class="keyword">const</span> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre>
<p>Copy assignment. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> FunT<span class="special">&gt;</span> <a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;</span> <a name="idp33902432-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="identifier">FunT</span> <span class="keyword">const</span> <span class="special">&amp;</span> fun<span class="special">)</span><span class="special">;</span></pre>
<p>Initializing assignment. Sets the specified function object to the filter. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp125605680"></a><h3>
<a name="idp33881440-bb"></a><code class="computeroutput">filter</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">result_type</span> <a name="idp33882000-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="identifier">attribute_value_set</span> <span class="keyword">const</span> <span class="special">&amp;</span> values<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Filtering operator.</p>
<p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">values</code></span></p></td>
<td><p>Attribute values of the log record. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p><code class="computeroutput">true</code> if the log record passes the filter, <code class="computeroutput">false</code> otherwise. </p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp33886128-bb"></a><span class="identifier">reset</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Resets the filter to the default. The default filter always returns <code class="computeroutput">true</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp33887888-bb"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="filter.html" title="Class filter">filter</a> <span class="special">&amp;</span> that<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Swaps two filters </p>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2007-2014 Andrey Semashev<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="expressions/attr_idp33863840.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../expressions.html#header.boost.log.expressions.filter_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="filter/default_filter.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
